﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EA3.BusinessLogic
{
    public class GenericSingleton<T> where T:class, new() 
    {
        private static T _singletonObject = default(T);

        public static T GetSingleton()
        {
            lock(typeof(T))
            {
                if (_singletonObject == null)
                    _singletonObject = new T();
             }
            return _singletonObject;
        }
    }
}
